//
//  MainViewController.m
//  Podcopter
//
//  Created by Ben Gotow on 2/1/10.
//  Copyright Apple Inc 2010. All rights reserved.
//

#import "MainViewController.h"
#import "DeviceMountedController.h"
#import "RemoteListController.h"

@implementation MainViewController


- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 
{
    if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
        // Custom initialization
    }
    return self;
}

- (IBAction)choseDeviceMounted
{
    UIImagePickerController  * c = [[UIImagePickerController alloc] init];
    [c setSourceType:UIImagePickerControllerSourceTypeCamera];
    [c setShowsCameraControls: NO];
    [self presentModalViewController:c animated:NO];
    
    DeviceMountedController * controller = [[DeviceMountedController alloc] initWithNibName:@"DeviceMountedController" bundle:nil];
	controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
	controller.imagePicker = c;
    
    UIWindow * w = [[UIWindow alloc] init];
    [w addSubview: [controller view]];
    [w makeKeyAndVisible];
}

- (IBAction)choseRemoteControl
{
	RemoteListController *controller = [[RemoteListController alloc] initWithNibName:@"RemoteListController" bundle:nil];
	controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;

	UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:controller];
	[controller release];

	[self presentModalViewController:navController animated:YES];
	[navController release];
}


- (void)dealloc {
    [super dealloc];
}


@end
